<?php

/**
 * Created by PhpStorm.
 * User: wenqiang.yq@gmail.com
 * Date: 16-3-4
 * Time: 上午10:12
 */
include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "ElasticSearch.php";

$es = new \ElasticSearch\ElasticSearch();
$result = $es->dsl()->term(array("data" => "222", "func" => 222));
$result = $es->dsl()->query("data=222 and func=ff or ");
print_r($result);


/**
 * {
 * "bool": {
 * "must":     [
 * { "term": { "folder": "inbox" }},
 * { "term": { "folder": "inbox" }}
 * ],
 * "must_not": { "term": { "tag":    "spam"  }},
 * "should": [
 * { "term": { "starred": true   }},
 * { "term": { "unread":  true   }}
 * ]
 * }
 * }
 */